import java.io.*;

public class LogisticsInfoWriter {
    public static void main(String[] args) {
        String templateFileName = "wuliu.template";
        String targetFileName = "物流.txt";

        String danhao = "123456789";
        String weizhi = "合大快递点";
        String tiquma = "85785";

        try (BufferedReader reader = new BufferedReader(new FileReader(templateFileName));
             BufferedWriter writer = new BufferedWriter(new FileWriter(targetFileName))) {

            String line;
            while ((line = reader.readLine()) != null) {
                line = line.replace("{danhao}", danhao)
                           .replace("{weizhi}", weizhi)
                           .replace("{tiquma}", tiquma);

                writer.write(line);
                writer.newLine(); 
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
